<template>
  <view class="content"></view>
</template>

<script>
import Vue from "vue";
export default {
  data() {
    return {};
  },
  onLoad() {
    this.loadExecution();
  },
  methods: {
    loadExecution: function() {
      /**
       * 获取本地存储中launchFlag的值
       * 若存在，说明不是首次启动，直接进入首页；
       * 若不存在，说明是首次启动，进入引导页；
       */
      try {
        const value = uni.getStorageSync("launchFlag");
        if (value) {
          if (value == true) {
             Vue.customSwitchTab('./home')
          } else {
             Vue.customRedirectTo('./loginnew')
          }
        } else {
          uni.setStorage({
            key: "launchFlag",
            data: true,
          });
          Vue.customRedirectTo('./loginnew')
        }
      } catch (e) {
        // error
        uni.setStorage({
          key: "launchFlag",
          data: true,
        });
       Vue.customRedirectTo('./loginnew')
      }
      return;
    Vue.customSwitchTab('./home')
    }
  }
};
</script>
<style>
</style>
